package sv.gob.mh.dgii.model;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;


@Embeddable
public class EdSolDocimFunicId implements java.io.Serializable {

	private static final long serialVersionUID = -3541662052804703244L;
	
	@Column(name = "I_INDICE", nullable = false, precision = 18, scale = 0)
	@NotNull
	private Long iindice;
	
	@Column(name = "N_CORRELATIVO", nullable = false, precision = 5, scale = 0)
	@NotNull
	private Integer ncorrelativo;

	public EdSolDocimFunicId() {
	}

	public EdSolDocimFunicId(Long iindice, Integer ncorrelativo) {
		this.iindice = iindice;
		this.ncorrelativo = ncorrelativo;
	}

	
	public Long getIindice() {
		return this.iindice;
	}

	public void setIindice(Long iindice) {
		this.iindice = iindice;
	}

	
	public Integer getNcorrelativo() {
		return this.ncorrelativo;
	}

	public void setNcorrelativo(Integer ncorrelativo) {
		this.ncorrelativo = ncorrelativo;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof EdSolDocimFunicId))
			return false;
		EdSolDocimFunicId castOther = (EdSolDocimFunicId) other;

		return (this.getIindice() == castOther.getIindice())
				&& ((this.getNcorrelativo() == castOther.getNcorrelativo()) || (this
						.getNcorrelativo() != null
						&& castOther.getNcorrelativo() != null && this
						.getNcorrelativo().equals(castOther.getNcorrelativo())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result + (int) this.getIindice().intValue();
		result = 37
				* result
				+ (getNcorrelativo() == null ? 0 : this.getNcorrelativo()
						.hashCode());
		return result;
	}

}
